<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="app">
    <cpn v-show="isShow"></cpn>
  </div>

  <template id="cpn">
    <div>
      <h2>我是子组件</h2>
      <p>我是内容哈哈哈</p>
      <button v-show="isShow">按钮</button>
    </div>
  </template>

  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        message: '你好啊',
        isShow: true
      },
      methods: {},
      components: {
        cpn: {
          template: '#cpn'
        },
        data() {
          return {
            isShow: false
          }
        }
      }
    });
  </script>
</body>

</html>